﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GroupManager.Class;

namespace GroupManager.User_Control
{
    public partial class header : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string path = Request.Url.AbsolutePath;
            if (path.ToUpper().Equals("/trangchu.aspx".ToUpper()) || path.ToUpper().Equals("/chitietthanhvien.aspx".ToUpper()))
            {
                return;
            }
            string mdoinhom = Request.QueryString["doinhom"];
            if (string.IsNullOrEmpty(mdoinhom))
            {
                Response.Redirect("trangchu.aspx");
            }
            int madoinhom = int.Parse(mdoinhom);
            if (madoinhom == 1)
            {
                Response.Redirect("trangchu.aspx");
            }
            bool kiemtra = LopDoiNhom.KiemTraDoiNhom(madoinhom);
            if (kiemtra == true)
            {
                Response.Redirect("trangchu.aspx");
            }
            imgHeader.ImageUrl = LopDoiNhom.LayBanner(madoinhom);
        }
    }
}